package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.PurchaseInvoiceRelationshipEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;


/**
 * @author yuqian
 * @version v1.0
 * @date 2019/2/26 16:20
 * @since v1.0
 */
public interface PurchaseInvoiceRelationshipDao {

    Integer insert(PurchaseInvoiceRelationshipEntity purchaseInvoiceRelationshipEntity);

    void batchInsert(List<PurchaseInvoiceRelationshipEntity> list);

    Integer update(PurchaseInvoiceRelationshipEntity purchaseInvoiceRelationshipEntity);

    Integer deleteByKey(@Param("key") Long key);

    PurchaseInvoiceRelationshipEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);


    List<PurchaseInvoiceRelationshipEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    void updateIsCancel(@Param("isCancel") Integer isCancel, @Param("param") Map<String, Object> param);

    void updateApprove(@Param("approveStatus") Integer approveStatus, @Param("param") Map<String, Object> param);

    /**
     * 批量更新金额
     * @param corpid
     * @param list
     * @throws
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    void updateBatchMoney(@Param("corpid") String corpid, @Param("list") List<PurchaseInvoiceRelationshipEntity> list);

    List<Map<String, Object>> getSumMoneyOfPurchase(@Param("param") Map<String, Object> param);

    List<Map<String, Object>> getSumMoneyOfPayPlan(@Param("param") Map<String, Object> param);

    List<Map<String, Object>> getSumMoneyOfPaySheet(@Param("param") Map<String, Object> param);

    Integer deleteByInvoiceId(@Param("purchaseInvoiceId") Long id, @Param("corpid") String corpid);

    Integer deleteByInvoiceIdIn(@Param("purchaseInvoiceIdIn") List<Long> purchaseInvoiceIdIn, @Param("corpid") String corpid);

}
